import org.apache.spark.sql.SparkSession

/**
  *
  * @author Abyss
  * @date 2019/8/30
  * @description
  */
object ConnectMysql {

  val options = Map(
    "url" -> "jdbc:mysql://192.168.0.204:3306/sgies_data_center",
    "user" -> "root",
    "password" -> "CyUr3qEk<*Do",
    "dbtable" -> "dc_real_data"
  )


  def main(args: Array[String]): Unit = {
    SparkSession.builder().appName("mysql_conn").master("local").getOrCreate()
      .sqlContext.read.format("jdbc").options(options).load()
      .show()
  }

}
